﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Repository;
using MAF.Common;

namespace Domain
{
    /// <summary>
    /// 存档管理类
    /// </summary>
    public class Archive
    {
        public void RevertNote(Guid id)
        {
            var note = Storage.MemNotes.GetById(id);
            note.IsComplete = false;
            Storage.MemNotes.Update(note);
        }

        public void DeleteNote(Guid id)
        {
            Storage.MemNotes.Remove(id);
        }

        public List<Note> ShowNotes()
        {
            var q = new Query<Note>();
            q.AddCriterion("IsComplete", Op.Equals, true);
            return Storage.MemNotes.GetByQuery(q);
        }
    }
}
